package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmSensitiveService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zzy
 * @date 2022/7/26 18:10
 */

@RestController
@RequestMapping("/api/v1/sensitive")
public class WmSensitiveController {

    @Autowired
    private WmSensitiveService wmSensitiveService;

    @PostMapping("/save")
    public ResponseResult inster(@RequestBody WmSensitive wmSensitive){
        return wmSensitiveService.inster(wmSensitive);
    }

    @PostMapping("list")
    public ResponseResult find(@RequestBody SensitiveDto sensitiveDto){
        return wmSensitiveService.find(sensitiveDto);
    }

    @PostMapping("update")
    public ResponseResult update(@RequestBody WmSensitive wmSensitive){
        return wmSensitiveService.update(wmSensitive);
    }

    @DeleteMapping("del/{id}")
    public ResponseResult delete(@PathVariable("id")Integer id){
        return wmSensitiveService.delete(id);
    }
}
